(PC-do-completion): Bind dirlength to nil to avoid
authorMartin Rudalics <rudalics@gmx.at>
Sat, 10 Mar 2007 08:37:51 +0000 (08:37 +0000)
committerMartin Rudalics <rudalics@gmx.at>
Sat, 10 Mar 2007 08:37:51 +0000 (08:37 +0000)
that buffer contents get erased during completion.

lisp/complete.el

index 104f37894035e23658f21c67cde1ff5840a6bb74..ce5094d1aef73e9608974aa041b5e937b4871065 100644 (file)
@@ -417,7 +417,10 @@ of `minibuffer-completion-table' and the minibuffer contents.")
         (pred minibuffer-completion-predicate)
         (filename (funcall PC-completion-as-file-name-predicate))
         (dirname nil)          ; non-nil only if a filename is being completed
-        (dirlength 0)
+        ;; The following used to be "(dirlength 0)" which caused the erasure of
+        ;; the entire buffer text before `point' when inserting a completion
+        ;; into a buffer.
+        dirlength
         (str (buffer-substring beg end))
         (incname (and filename (string-match "<\\([^\"<>]*\\)>?$" str)))
         (ambig nil)